#include("../../comm/FormHead.html")
<div id="main">
    <form action="" class="layui-form margin-10" lay-filter="form">
        <input type="hidden" id="actions" name="actions" value="#(form.actions)">
        <input type="hidden" id="access_token" name="access_token" value="#(app.access_token)">
        <input type="hidden" id="c_date" name="c_date" value="#(app.c_date)">
        #(token??)

        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">主键ID</label>

                    <div class="layui-input-block">
                        <input type="text" name="aid" readonly placeholder="自动生成"
                               value="#(app.aid)" class="layui-input input-readonly">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">应用名</label>

                    <div class="layui-input-block">
                        <input type="text" id="app_name" name="app_name" placeholder="请输入应用名"
                               value="#(app.app_name)" class="layui-input ">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">appid</label>

                    <div class="layui-input-block">
                        <input type="text" id="app_id" name="app_id" placeholder="请输入APPID"
                               value="#(app.app_id)" class="layui-input ">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">appsecret</label>

                    <div class="layui-input-inline" style="width:300px">
                        <input type="text" id="app_secret" name="app_secret" readonly placeholder="请输入调用密码"
                               value="#(app.app_secret)" class="layui-input input-readonly">
                    </div>
                    <div class="layui-input-inline" style="margin-top:5px">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm btn-change-11" lay-event="InitAppSecret">生成</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">启停</label>

                    <div class="layui-input-block">
                        <input type="checkbox" lay-skin="switch" name="status" id="status" value="1" lay-text="启用应用|停用应用" #(app.status==1?'checked':'')>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>

                    <div class="layui-input-block">
                        <textarea name="app_desc" placeholder="请输入备注" class="layui-textarea" style="height:120px">#(app.app_desc)</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="Submit1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<SCRIPT LANGUAGE="JavaScript">
    <!--
    layui.use(['util'], function () {
        layui.util.event("lay-event", {
            InitAppSecret: function () {
                layui.$.get("InitAppSecretApi", {}, function (res) {
                    layui.$("#app_secret").val(res.data);
                });
            }
        });
    });
    layui.use(['form', 'myTool'], function () {
        layui.form.on('submit(Submit1)', function (data) {
            layui.myTool.postJson("ModifySysAppApi", data.field, function () {
                parent.layer.closeAll();
            });
            return false;
        });
    });
    //-->
</SCRIPT>
</body>
</html>